package com.bl.student.dao.model;

import com.bl.student.common.enums.ValidStatus;
import com.bl.student.dao.model.converter.DatetimeConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by liangweikang on 18/2/1.
 */
@Entity
@Data
@Table(name = "VIP")
@ApiModel(value = "VipEntity", description = "VIP信息")
@DynamicInsert
@DynamicUpdate
public class VipEntity {

    @Id
    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "用户id")
    @Column(name = "user_id")
    private String userId;

    @Enumerated(EnumType.STRING)
    @ApiModelProperty(value = "vip状态")
    private ValidStatus status;

    @ApiModelProperty(value = "到期时间")
    @Column(name = "expiration_time")
    @Convert(converter = DatetimeConverter.class)
    private Long expirationTime;

    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_time")
    @Convert(converter = DatetimeConverter.class)
    private Long createTime;

    @ApiModelProperty(value = "更新时间")
    @Column(name = "update_time")
    @Convert(converter = DatetimeConverter.class)
    private Long updateTime;

}
